Testing
– Unit testing: Individual units or components of a program are tested -Integration testing: Individual units are combined and tested as a group -System testing: The complete integrated application is tested as a whole -Acceptance testing: The complete application is tested by users before its deployment– Valid/Invalid/Boundary test cases Based upon “correct” input data Based upon “incorrect” input data Boundary values of the “equivalence class” for valid cases
– Debugging: print, assert
![]()
Exceptions and errors
---Syntax errors: cannot be understood by the compiler/interpreter ---Run-time errors: Occur during execution; errors that are anticipated and can be dealt with appropriately ---Logic errors: Incorrect implementation of the program’s logic – Exception handling:![]()
▪ try except ▪ else finally
Else和finally是可有可无的,不管情况如何都要执行finally的内容